Sets our main struct and passes it to the parent class.
Creates a new shortcut controller.
Creates a new shortcut controller that takes its shortcuts from the given list model.
Adds @shortcut to the list of shortcuts handled by @self.
Gets the mnemonics modifiers for when this controller activates its shortcuts.
Gets the scope for when this controller activates its shortcuts.
Get the main Gtk struct
the main Gtk struct as a void*
Removes @shortcut from the list of shortcuts handled by @self.
Sets the controller to use the given modifier for mnemonics.
Sets the controller to have the given @scope.
the main Gtk struct
Get the main Gtk struct
Get the item at @position.
Gets the type of the items in @list.
Gets the number of items in @list.
Get the item at @position.
Emits the #GListModel::items-changed signal on @list.
This signal is emitted whenever items were added to or removed from @list. At @position, @removed items were removed and @added items were added in their place.
Get the main Gtk struct
Gets the ID of the @buildable object.
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
Returns the event that is currently being handled by the controller.
Returns the device of the event that is currently being handled by the controller.
Returns the modifier state of the event that is currently being handled by the controller.
Returns the timestamp of the event that is currently being handled by the controller.
Gets the name of @controller.
Gets the propagation limit of the event controller.
Gets the propagation phase at which @controller handles events.
Returns the GtkWidget this controller relates to.
Resets the @controller to a clean state.
Sets a name on the controller that can be used for debugging.
Sets the event propagation limit on the event controller.
Sets the propagation phase at which a controller handles events.
Get the main Gtk struct
the main Gtk struct as a void*
Get the item at @position.
Gets the type of the items in @list.
Gets the number of items in @list.
Get the item at @position.
Emits the #GListModel::items-changed signal on @list.
This signal is emitted whenever items were added to or removed from @list. At @position, @removed items were removed and @added items were added in their place.
Get the main Gtk struct
the main Gtk struct as a void*
Gets the ID of the @buildable object.
GtkShortcutController is an event controller that manages shortcuts.
Most common shortcuts are using this controller implicitly, e.g. by adding a mnemonic underline to a GtkLabel, or by installing a key binding using [method@Gtk.WidgetClass.add_binding], or by adding accelerators to global actions using [method@Gtk.Application.set_accels_for_action].
But it is possible to create your own shortcut controller, and add shortcuts to it.
GtkShortcutController implements GListModel for querying the shortcuts that have been added to it.
GtkShortcutController as a GtkBuildable
GtkShortcutControllers can be creates in ui files to set up shortcuts in the same place as the widgets.
An example of a UI definition fragment with GtkShortcutController:
This example creates a [class@Gtk.ActivateAction] for triggering the activate signal of the GtkButton. See [ctor@Gtk.ShortcutAction.parse_string] for the syntax for other kinds of GtkShortcutAction. See [ctor@Gtk.ShortcutTrigger.parse_string] to learn more about the syntax for triggers.